<?php


define('DISPLAY_ERRORS', true);
define('DISPLAY_EXCEPTIONS', true);

set_time_limit(0);
ini_set('memory_limit',-1);
ini_set('max_execution_time',0);
ini_set('ignore_user_abort','On');
ini_set('display_errors', (DISPLAY_ERRORS)?(1):(0));
ini_set('display_startup_errors', (DISPLAY_ERRORS)?(1):(0));
error_reporting((DISPLAY_ERRORS)?(1):(0));
ignore_user_abort (true);
date_default_timezone_set('Europe/Bucharest');

/**
*
* SMTP4PHP :  PHP powerful tool for sending e-mails fast and easily.
*
* SMTP4PHP is a collection of PHP classes, dedicated for composing and sending 
* multipart/mixed email messages quickly and easily, with or without embedded 
* images and/or attachments.
*
* Copyright (c) 2011 - 2012, Raul IONESCU <ionescu.raul@gmail.com>, 
* Bucharest, ROMANIA
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @package      SMTP4PHP
* @author       Raul IONESCU <ionescu.raul@gmail.com>
* @copyright    Copyright (c) 2011 - 2012, Raul IONESCU.
* @license      http://www.opensource.org/licenses/mit-license.php The MIT License
* @version      2011, 14th release  
* @link         https://plus.google.com/u/0/109110210502120742267
* @access       public
*
* PHP versions 5.3 or greater
*/

/*

GMail - TLS encryption example 
==============================================
define('SMTP_SERVER','tls://smtp.gmail.com');
define('SMTP_SERVER_PORT',587);

GMail - SSL encryption example 
==============================================
define('SMTP_SERVER','ssl://smtp.gmail.com');
define('SMTP_SERVER_PORT',465);

Yahoo Mail - SSL encryption example
==============================================
define('SMTP_SERVER','ssl://smtp.mail.yahoo.com');
define('SMTP_SERVER_PORT',465);

Windows Live.com - TLS encryption example
==============================================
define('SMTP_SERVER','tls://smtp.live.com');
define('SMTP_SERVER_PORT',587);

*/

define('SMTP_SERVER','ssl://smtp.gmail.com');
define('SMTP_SERVER_PORT',465);

define('SMTP_USER','tranvulong09bit2@gmail.com');
define('SMTP_PASSWORD','rongconhat');

define('FROM_NAME','Long');
define('FROM_EMAIL',SMTP_USER);

//define('TO_NAME','Tin');
//define('TO_EMAIL','0959025@itec.hcmus.edu.vn');
/*///////////////////////////////////////////////////////////////////////////////////////*/
/*///////////////////////////////////////////////////////////////////////////////////////*/
/*///////////////////////////////////////////////////////////////////////////////////////*/

require_once('SMTP4PHP.php');
use SMTP4PHP\User;
/* 
//NOTE: Only if backward compatibility is really needed.
use SMTP4PHP\eMailUser; 
*/
use SMTP4PHP\eMail;
use SMTP4PHP\SMTP;

$e = new eMail();
$e->from = new User(FROM_NAME, FROM_EMAIL);
$e->to = new User(FROM_NAME, FROM_EMAIL);
$e->subject = 'Notification';
/* 
// EXAMPLE: add inline image example
$e->htmlMessage = 'This is a HTML message!<br><img src="'.$e->addImage('./image.jpg').'" border="0">';
*/
$e->txtMessage = 'You have a survey!';
/*
// EXAMPLE: add attachment example
$e->addAttachment('Attachment.zip'); 
*/
$smtp = new SMTP(SMTP_SERVER, SMTP_SERVER_PORT, SMTP_USER, SMTP_PASSWORD);
/* NOTE: ALL emails are sent through the same connection, speeding up transmission. */
try { $smtp->send($e); /* OR $smtp->send($e,$e2);*/ } 
catch(Exception $e) { }
//var_dump($smtp->SMTPlog);

$test1 = $_POST['mybox'];
echo($test1);


/*///////////////////////////////////////////////////////////////////////////////////////*/
/*///////////////////////////////////////////////////////////////////////////////////////*/
/*///////////////////////////////////////////////////////////////////////////////////////*/
?>
